import Vue from 'vue'
import router from './router'
import store from './store'
import './registerServiceWorker'
import 'font-awesome/css/font-awesome.min.css'
import globalComponents from "./assets/js/globalComponents.js"
import globalFilters from "./assets/js/globalFilters.js"
import { get, post, del } from '@/assets/js/http.js'
import Preview from '@/components/previewImage/index'
Vue.use(globalComponents)
Vue.use(globalFilters).use(Preview)
Vue.mixin({
	computed: {
		buttons() {
			return this.$store.state.buttons;
		}
	},
	methods: {
		findButton(name) {
			return this.$store.state.buttons.find(item => item.title === name)
		},
	}
})

Vue.config.productionTip = false
Vue.prototype.$get = get
Vue.prototype.$post = post
Vue.prototype.$del = del


// 获取当前路由下面的权限
import {getRouteAuth,auth} from '@/assets/js/auth'
Vue.prototype.$getRouteAuth =(path = router.currentRoute.path)=> new getRouteAuth(path)
Vue.prototype.$auth=auth


import App from './App.vue'


new Vue({
	router,
	store,
	render: h => h(App)
}).$mount('#app')
